bottomDragAction.connect('activated', () => {
this.open(Main.layoutManager.bottomIndex);
});
- Main.layoutManager.connect('keyboard-visible-changed', (_manager, visible) => {
- bottomDragAction.cancel();
- bottomDragAction.set_enabled(!visible);
- });
global.stage.add_action(bottomDragAction);
+ this._bottomDragAction = bottomDragAction;
this._syncEnabled();
}
if (enabled && !this._keyboard) {
this._keyboard = new Keyboard();
+ this._keyboard.connect('visibility-changed', () => {
+ this._bottomDragAction.enabled = !this._keyboard.visible;
+ });
} else if (!enabled && this._keyboard) {
this._keyboard.setCursorLocation(null);
this._keyboard.destroy();
this._keyboard = null;
+ this._bottomDragAction.enabled = true;
}
}
}
};
-var Keyboard = GObject.registerClass(
-class Keyboard extends St.BoxLayout {
+var Keyboard = GObject.registerClass({
+ Signals: {
+ 'visibility-changed': {},
+ },
+}, class Keyboard extends St.BoxLayout {
_init() {
super._init({ name: 'keyboard', reactive: true, vertical: true });
this._focusInExtendedKeys = false;
this._showIdleId = 0;
this._keyboardVisible = false;
- this._connectSignal(Main.layoutManager, 'keyboard-visible-changed', (_lm, visible) => {
- this._keyboardVisible = visible;
- });
this._keyboardRequested = false;
this._keyboardRestingId = 0;
this._animateShowComplete();
},
});
- Main.layoutManager.emit('keyboard-visible-changed', true);
+ this._keyboardVisible = true;
+ this.emit('visibility-changed');
}
_animateShowComplete() {
},
});
- Main.layoutManager.emit('keyboard-visible-changed', false);
+ this._keyboardVisible = false;
+ this.emit('visibility-changed');
}
_animateHideComplete() {
};
var LayoutManager = GObject.registerClass({
- Signals: { 'hot-corners-changed': {},
- 'startup-complete': {},
- 'startup-prepared': {},
- 'monitors-changed': {},
- 'system-modal-opened': {},
- 'keyboard-visible-changed': { param_types: [GObject.TYPE_BOOLEAN] } },
+ Signals: {
+ 'hot-corners-changed': {},
+ 'startup-complete': {},
+ 'startup-prepared': {},
+ 'monitors-changed': {},
+ 'system-modal-opened': {},
+ },
}, class LayoutManager extends GObject.Object {
_init() {
super._init();